{{!--
  Original work Copyright (c) 2015 Nils Knappmeier
  https://github.com/bootprint/bootprint-openapi

  Renders a json.schema inside a panel.
  @public
  @readonly
--}}
<div id="definition-{{htmlId @key}}" class="definition panel"
  data-traverse-target="definition-{{htmlId @key}}">
  {{#if title}}
    {{#if anchor}}
      <h2 class="panel-title">
        <a name="/definitions/{{title}}"></a>{{title}}:
        {{type}}
        <!-- <span class="json-property-type">{{>json-schema/datatype}}</span> -->
      </h2>
    {{else}}
      <h2 class="panel-title">{{title}}</h2>
    {{/if}}
  {{/if}}

  <div class="doc-row">
    <div class="doc-copy">
      {{#if $ref}}
        {{>json-schema/reference .}}
      {{else}}
        {{#if enum}}
          {{#if description}}
            <section class="json-schema-description">
              {{md description}}
            </section>
          {{/if}}
          {{~>json-schema/datatype}}
        {{else}}
          {{>json-schema/body}}
        {{/if}}
      {{/if}}
    </div>

    {{! Print examples without whitespace }}
    {{#ifneq type 'string'}}
      <div class="doc-examples">
        <section>
          <h5>Example</h5>
          {{>swagger/print-example .}}
        </section>
      </div>
    {{/ifneq}}
  </div>
</div>
